UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZI01o2Qvfk016YavrC9hhoeX2wY4mItjFTX/0Lnq5rE='
WHERE
key_id = '7f08465360d1adef140e52cee93f144cb01f93989c84abac6c7e6c9dc8ffc2db'
AND (
token = 'ZI01o2Qvfk016YavrC9hhoeX2wY4mItjFTX/0Lnq5rE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)