UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '86sIXWxCF/DPXrViUhGtojsGg4F1oPF99h4+bDAzfjE=' 
WHERE 
  key_id = 'c1778151ff16cb3a7c2ed2eae314dee699a871354d5d411a516e4725b1f828f7' 
  AND (
    token = '86sIXWxCF/DPXrViUhGtojsGg4F1oPF99h4+bDAzfjE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050