UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5sRZWCfv+ntzdtC4yOhnnsNYD+2bNP/kLwepeNtUNWs='
WHERE
key_id = '00c3c157e0574a19e848a0c8a4f8aef26f732f3964130d56f5281a8600d35fb0'
AND (
token = '5sRZWCfv+ntzdtC4yOhnnsNYD+2bNP/kLwepeNtUNWs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)