UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9pbytu6SYDt+YViNwKhIKCraeHHJLKmogWn/yg2ss2c='
WHERE
key_id = 'e7536c5c1c3464ddec5bd2e29c287c843c361a4ee38e4c25cbc7ccc29754d5f6'
AND (
token = '9pbytu6SYDt+YViNwKhIKCraeHHJLKmogWn/yg2ss2c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)