UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ol2UorwZZ/oQUEhkrbI7AtZUgYY8nvDM3oN9OaKfzE8=' 
WHERE 
  key_id = '97871111a8a8683f16b0279b857d3570266dcf8be638fd8a9d25f85ae761ba27' 
  AND (
    token = 'ol2UorwZZ/oQUEhkrbI7AtZUgYY8nvDM3oN9OaKfzE8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033