UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UB3x5cvyXJoevDGrNBeimRTYSyb+OevreSPgPjCIoiM=' 
WHERE 
  key_id = 'f3bef4553eb9b16069ac168b6c5ee79fa51c345f6a7efd8e523ed9daa4d66e21' 
  AND (
    token = 'UB3x5cvyXJoevDGrNBeimRTYSyb+OevreSPgPjCIoiM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047