UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uz5Frqfxu6rUCvaL7jq2vgi1MyeumElg17iULYXQJ1E=' 
WHERE 
  key_id = '9c03eb237e20f99c332ee5537b62767764d855ae7c165019d0ee69a30acd138b' 
  AND (
    token = 'uz5Frqfxu6rUCvaL7jq2vgi1MyeumElg17iULYXQJ1E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034