UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'C/+jeDvgDBuyDd3P4dq8c6FRveQ5HWf2T8GWcsEoU+I=' 
WHERE 
  key_id = '9b62ae7f7564582ae10e898dbd8db1e92bc727be58e9b2df6ee1cc481c7cdc3b' 
  AND (
    token = 'C/+jeDvgDBuyDd3P4dq8c6FRveQ5HWf2T8GWcsEoU+I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026