UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xqIIUTPe1gcFHgkhLl932L9fHyceFBIzIMYUbA554I4=' 
WHERE 
  key_id = '631aa47ad5f7155d0eb2b322b88a58e1941b3604cd07e89f3ee668f5271e55d9' 
  AND (
    token = 'xqIIUTPe1gcFHgkhLl932L9fHyceFBIzIMYUbA554I4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042