UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dIWf4bnL57O5Lw2OZ+O3TX42Br/lcEKmxRRNH0yedMs=' 
WHERE 
  key_id = '3c84506ffe5ca4edf0c3d5b2cdb85149f15ce2cbbac6f46c91cb9b132e1e3932' 
  AND (
    token = 'dIWf4bnL57O5Lw2OZ+O3TX42Br/lcEKmxRRNH0yedMs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029