UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kI9//vyCmtDkQtgr3JhTvFY4AbpxQoCb6yzxzKDXFlQ='
WHERE
key_id = 'abf31c10799106908803775dc618fa658de9c8624c00bb9c1fe2505032cc695a'
AND (
token = 'kI9//vyCmtDkQtgr3JhTvFY4AbpxQoCb6yzxzKDXFlQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)