UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zkmN4S6SNGf/+hVYpN6LEHfEW9Bnj7QMBkecscGkPAE=' 
WHERE 
  key_id = 'acf3447ebcd0fb07864507bc93f47706091dc5e2abf0e1a7967efb20d722072e' 
  AND (
    token = 'zkmN4S6SNGf/+hVYpN6LEHfEW9Bnj7QMBkecscGkPAE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021