UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mlwxK9119MW333Kg2tAn42UZZ0x0/i0uOO6VPpPver8=' 
WHERE 
  key_id = '9516a85d255c5a67a3f8b2345059474ee3cd4f37fdba99799dc484c99fe98f5c' 
  AND (
    token = 'mlwxK9119MW333Kg2tAn42UZZ0x0/i0uOO6VPpPver8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036