UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '18jl1i+wHh1FLhcwvMuZYY1q97iaXuSJq58KOlUu3rs=' 
WHERE 
  key_id = 'a09f0ce23a3d019ecdf88c202e6a574020a6553291fdd25cab823b0878c3c835' 
  AND (
    token = '18jl1i+wHh1FLhcwvMuZYY1q97iaXuSJq58KOlUu3rs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023