UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'y/SLFfJr44+dboF0+GG7Ed2FRhsrROSTdzfs8nf4FUc=' 
WHERE 
  key_id = '345197f680a5dedc32147fa1ee90a680ff0465d88b2cc21e9be362d74c59ae76' 
  AND (
    token = 'y/SLFfJr44+dboF0+GG7Ed2FRhsrROSTdzfs8nf4FUc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020