UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GQll8NbcSQ0wvLHgGGD3NGLSuk0zWHz+lq13igKXugQ=' 
WHERE 
  key_id = 'c0179983bdbbb19009039dbfe1019daba02a6979da997266634fb1bbd4cdd555' 
  AND (
    token = 'GQll8NbcSQ0wvLHgGGD3NGLSuk0zWHz+lq13igKXugQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037