UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nfTx5/eJ2PqnMa397CXcXoxcmj7HwCvnLUhLOyQUSas=' 
WHERE 
  key_id = 'c3693fe49e7ce3ddfc7a4e198eb1be68e334221071a8ac3df3d9a6c3fb728043' 
  AND (
    token = 'nfTx5/eJ2PqnMa397CXcXoxcmj7HwCvnLUhLOyQUSas=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029