UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4XVv+jfBOOVVO7L88UT5ywbTke5TJQ0JZ5ZeRQ751ys='
WHERE
key_id = '3a9bd3f3660f10a92df7c808864fc6184856248b877a528eccec8471993251a2'
AND (
token = '4XVv+jfBOOVVO7L88UT5ywbTke5TJQ0JZ5ZeRQ751ys='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)