UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 's/xR44lr5Z7gYLfgGD8qrOwcOkU5Gfg8CX+8lkXsKjI='
WHERE
key_id = '04f60961d3d09c9bda8e74e8c14a5eabf6803317e84dbeb210105cf740c85d4e'
AND (
token = 's/xR44lr5Z7gYLfgGD8qrOwcOkU5Gfg8CX+8lkXsKjI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)