UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EP1HDPmGPw1Bbx+/GlEqiKI8zqdi61mfeDVu8KyA+OY='
WHERE
key_id = '29d1ef9c45e84241d44fe207b4ef2be38cdeecc38468093b214ca6bd707255e9'
AND (
token = 'EP1HDPmGPw1Bbx+/GlEqiKI8zqdi61mfeDVu8KyA+OY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)