UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6RgvCdFzsKhBCR4gYSQa57HgfLfWZOnabEI3JGizw1E=' 
WHERE 
  key_id = '4cec017951cf42e5dc957b98c7feef071a64762979836a03cd775dc2330297dc' 
  AND (
    token = '6RgvCdFzsKhBCR4gYSQa57HgfLfWZOnabEI3JGizw1E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027