UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TZrWlWmJftwgLQN/kSwVfs7o99la/gT7WHkAEGdxl08='
WHERE
key_id = '45c1f743f330bdc99567b438848d24388271f92e9853917ef0396ffc40b451b6'
AND (
token = 'TZrWlWmJftwgLQN/kSwVfs7o99la/gT7WHkAEGdxl08='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)