UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VAoGgwooGaAqnty9N60jL4ashJYylhtfb1Jn8dccSsI=' 
WHERE 
  key_id = '55b8690dd04c90ef40fd33b343369eb7462779f48b132aa8844ba72cf8f482bb' 
  AND (
    token = 'VAoGgwooGaAqnty9N60jL4ashJYylhtfb1Jn8dccSsI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042