UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'twKDaE4YEuhVU5lPcmaAAeP6wP26+k7RZXT49ncr5ao=' 
WHERE 
  key_id = '6ac0ffd5dd8e71d12397f5ddd33fce98ccbbffbc119ea295ae915fa983696a30' 
  AND (
    token = 'twKDaE4YEuhVU5lPcmaAAeP6wP26+k7RZXT49ncr5ao=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033