UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pDn4+mn7AzgFn9N/A1c+n+Gok1xl12k57fSgqKcjAtg=' 
WHERE 
  key_id = '6e969ebfe65973fd92b1c6ef40ae9a37a84611afdf166c2c0950f9d0e8041d37' 
  AND (
    token = 'pDn4+mn7AzgFn9N/A1c+n+Gok1xl12k57fSgqKcjAtg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00052