UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'V/+F5edYcgHt66WgjAxRpn+2G5+7lLfSX2y+BlG1Vvk='
WHERE
key_id = '1e3e10e80f49029ea835a17cccf45cda19b0e236bcfb99f14429a000194f6dcb'
AND (
token = 'V/+F5edYcgHt66WgjAxRpn+2G5+7lLfSX2y+BlG1Vvk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)