UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'sYF+VLxoyhZk+tdH1XJcdYtvMO2WctufQiDB7/ONMfA=' 
WHERE 
  key_id = '93ad6207edd06d7e2f3c6d62811f7f90e3b71c5e8417861880ea02c8075f18f5' 
  AND (
    token = 'sYF+VLxoyhZk+tdH1XJcdYtvMO2WctufQiDB7/ONMfA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028