UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4shRnblBxtIbDb63IzwniNuhdtyB+Xg+pRuTU0FzR7g=' 
WHERE 
  key_id = '62396d8de4b4fe7a71974fa6584b890a60f763dac23a526ca5c78727433d329e' 
  AND (
    token = '4shRnblBxtIbDb63IzwniNuhdtyB+Xg+pRuTU0FzR7g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026