UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '88OH0D13h71pocQipoS4/2HWFxbcG3HqnW+PHPxCrT4=' 
WHERE 
  key_id = '684709e50103e35c2520601f4e26676a08c1bff7c7e256c7f70985925b9d7924' 
  AND (
    token = '88OH0D13h71pocQipoS4/2HWFxbcG3HqnW+PHPxCrT4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045