UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mPuazLCROisaWzHkj1b3zTv2joEuj2tg4VcBG5MBgBc=' 
WHERE 
  key_id = 'f91df4f0985d55a472b192044af22688406ee5a602ed595d28c90d7bc101a579' 
  AND (
    token = 'mPuazLCROisaWzHkj1b3zTv2joEuj2tg4VcBG5MBgBc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031