UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Dyqzsdiw0z9kyT5+PLF33811CZyBgWL2xMjtv1eEz2s=' 
WHERE 
  key_id = '62f80b0ecc59db1525a6488f836762079e8c662ec313a4e05a48c265a7d65f94' 
  AND (
    token = 'Dyqzsdiw0z9kyT5+PLF33811CZyBgWL2xMjtv1eEz2s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032