UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Tap5nkgmj1RBS+lA7wqRIFtwBglGQcw9ax0CJh4N91g=' 
WHERE 
  key_id = 'f3faade16bb94200156f5b230a7d1de9147e1c6e0b4124c7f5c1336aed91b234' 
  AND (
    token = 'Tap5nkgmj1RBS+lA7wqRIFtwBglGQcw9ax0CJh4N91g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039