UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1NUmOeKdIiuVbTXF+qpbYMAv6fYENL7zcLduIEiBkmI=' 
WHERE 
  key_id = '92ce31dc197f5f4d9430feae6cf291fcbb25250ad7b8945bc418d20829e0aeb2' 
  AND (
    token = '1NUmOeKdIiuVbTXF+qpbYMAv6fYENL7zcLduIEiBkmI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025