UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IYafTFYiy6xYGrrWzVbFA5fTyzd331GYuN9cL/TAI6s='
WHERE
key_id = '988e0cf0395a0327cf97ae30f4f65cb040112d7322542f6acaa26491140471bf'
AND (
token = 'IYafTFYiy6xYGrrWzVbFA5fTyzd331GYuN9cL/TAI6s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)