UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wlBSFw42mOKIxp6vpCMzfIZEWWpGiHB+ugJVgRP46EM='
WHERE
key_id = '80e7e08e21239eae1985b3a4554cef86042691014fdd1ae2e0c79319ad375130'
AND (
token = 'wlBSFw42mOKIxp6vpCMzfIZEWWpGiHB+ugJVgRP46EM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)