UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ol1eZB3KU/HrVbtPC2cSHsy3G5npx/oem7whpNU/olI='
WHERE
key_id = '117baa16c26906dc35745bcd838500dd4fcff0d5ec9d608cd8658af1ac67fab4'
AND (
token = 'ol1eZB3KU/HrVbtPC2cSHsy3G5npx/oem7whpNU/olI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)