UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6tB/XrjJ5LoRWVCbmb9XNpzI3ECoPiqM+AbiVy4lgzE=' 
WHERE 
  key_id = '4e9972bec7cb21746b9dc1d492a63f98f9dcc08c8d19f8147b5052dd0e061886' 
  AND (
    token = '6tB/XrjJ5LoRWVCbmb9XNpzI3ECoPiqM+AbiVy4lgzE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016