UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Glyx5oZ32zSnuDNsWCmkSKc4PMw3ULQGHSNRj+vCCpc=' 
WHERE 
  key_id = '3c579e733905cd068fd02507c173bea449465540001cb4629122f2b82f63bade' 
  AND (
    token = 'Glyx5oZ32zSnuDNsWCmkSKc4PMw3ULQGHSNRj+vCCpc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046