UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rryP4OFxAd8FXniGL6kyI1DZ/wOpEnHYXdYtn14fqz0=' 
WHERE 
  key_id = '6269ac5c51eb46c43a7a1c52db2cca9a09f14f809fbb5ae7432fbc16436dfb87' 
  AND (
    token = 'rryP4OFxAd8FXniGL6kyI1DZ/wOpEnHYXdYtn14fqz0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015