UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NQfm/Whe3ASFBTLJhC7XcXosSPkXpbHW5u0epu+hFY0=' 
WHERE 
  key_id = '78e0380b6a4c24a9f86a85a9f39744eb1695e11d4c6c7ed5c6195a4df9b74593' 
  AND (
    token = 'NQfm/Whe3ASFBTLJhC7XcXosSPkXpbHW5u0epu+hFY0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016