UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WSBUgT/bvTXudeSJ84Vq+a1xP2v/ZBBhXAhzqkvvE5s=' 
WHERE 
  key_id = '339146325e627c73308899137db8a22297175b73e0ac17844fbcbe7cb90bf779' 
  AND (
    token = 'WSBUgT/bvTXudeSJ84Vq+a1xP2v/ZBBhXAhzqkvvE5s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050