UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'iHLApCLLUqBbWwTcoQ/k1zjddm7ZLNyeyJo9+7hDnNU=' 
WHERE 
  key_id = '8b21e2a0ffd1251eb4dd2be3bf1342b49dfeab99a642b553c53132016b63a99c' 
  AND (
    token = 'iHLApCLLUqBbWwTcoQ/k1zjddm7ZLNyeyJo9+7hDnNU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018