UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lTA/6n0Sk4NLKnIee/DQKDjlbsNvluRXBdn6RvkeQSY=' 
WHERE 
  key_id = '2c57477f56b0bd1a7b9f5e0fab85d09b9e92eb818fd04e96d71a53ab83e2d862' 
  AND (
    token = 'lTA/6n0Sk4NLKnIee/DQKDjlbsNvluRXBdn6RvkeQSY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050