UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WvCvz5WQdyglKtMIQKe3YJGyDswAPN7l/mx5gC1SEIo=' 
WHERE 
  key_id = '859b5619028f40fa4ffa1d78af9ff1ae9947ec4816073172e745e41c63ef3e58' 
  AND (
    token = 'WvCvz5WQdyglKtMIQKe3YJGyDswAPN7l/mx5gC1SEIo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026