UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'twr2jhoXMTFaedWRHIJGIf/Ce+OouL8m1X/SGtxp888=' 
WHERE 
  key_id = '61b7929f634991f3c36ea0c6436648a24261cc5cb796078fb8efaa65796e2f18' 
  AND (
    token = 'twr2jhoXMTFaedWRHIJGIf/Ce+OouL8m1X/SGtxp888=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036