UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'USI7p7J0XOGG6ZBCl6D9PAg7aciMbMpKZGWkKcCtftM='
WHERE
key_id = '6b5a092b7baed2de197fc13097918b794761e5cef2381035d893ab2f4b3872f4'
AND (
token = 'USI7p7J0XOGG6ZBCl6D9PAg7aciMbMpKZGWkKcCtftM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)