UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8FVxHV4jpx+EF5i31U2QPE6Jbct5uC7z1eA1tCqz/UQ=' 
WHERE 
  key_id = '96330d91cdf401fca63777ba4687d51b5d9534d5fa3616ac788602c2573ad8bd' 
  AND (
    token = '8FVxHV4jpx+EF5i31U2QPE6Jbct5uC7z1eA1tCqz/UQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031