UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vKF/NZY46RIMvBAIMJQphSWU9sbPIZ8MsduXIMtY5QI=' 
WHERE 
  key_id = '2e9788b6385e3c757c93d11e1d3343d8ff0ef1b331064ba59cf00d5921ada0e7' 
  AND (
    token = 'vKF/NZY46RIMvBAIMJQphSWU9sbPIZ8MsduXIMtY5QI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00069