UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/tMiO5OTWcoCIWBjaO8Sjqc7qyYdqYmR+1LnrWZIOqQ=' 
WHERE 
  key_id = '20179c6e3ed9febff5b130ece01a1b57445b6536ff22fef6dbaef29c6e206a72' 
  AND (
    token = '/tMiO5OTWcoCIWBjaO8Sjqc7qyYdqYmR+1LnrWZIOqQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016