UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NLGnPiuKaEuRWj/xhbZVC287OKCgKXUiQennpcIfSvQ=' 
WHERE 
  key_id = '96698c2748d48e3f4dcbcbd9e64b077ed4ffa4232670644f295024d9ff202fad' 
  AND (
    token = 'NLGnPiuKaEuRWj/xhbZVC287OKCgKXUiQennpcIfSvQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023