UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VfcQhIpNCo0Q8wJl4KnGHNnj8srdOszENkdN9DHqV8U=' 
WHERE 
  key_id = '5524c9ef565d6eda4aeaf0b6afd8f7ebeb23bcbcc27732288b28d9b82b780408' 
  AND (
    token = 'VfcQhIpNCo0Q8wJl4KnGHNnj8srdOszENkdN9DHqV8U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020