UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2s8eVTmSBcuyqUIxFIHN/cg38nLIZNUIav1z5jtebDE=' 
WHERE 
  key_id = '727e3c052fe368553d2b8f617c94ed6659fc083b94099606f9823e00a81ba88b' 
  AND (
    token = '2s8eVTmSBcuyqUIxFIHN/cg38nLIZNUIav1z5jtebDE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027