UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tyEHFJRAX9IGgFge+3dMBYlorF9LnmHwHpLb1wd7HOM='
WHERE
key_id = '16e13fca824531984d9fbaede397910de1a3a0342a1c1165dfdd1341e1926b78'
AND (
token = 'tyEHFJRAX9IGgFge+3dMBYlorF9LnmHwHpLb1wd7HOM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)