UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZZZiY4eMX+Ixy9JTaZVUbyBNx8i+HY/7M8oHKBnmtj0=' 
WHERE 
  key_id = 'd68a36d1d3ed1deb532c8bb50521c831310d6f5448369bdc9001497fbab5b7b5' 
  AND (
    token = 'ZZZiY4eMX+Ixy9JTaZVUbyBNx8i+HY/7M8oHKBnmtj0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031