UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Xtaml5MsHFOP9zbary6lxRYw6W/e4MDDXQJZrVtge6g='
WHERE
key_id = '43cc106ebb4ab85cdd647fa79885ec1d601bec7bbb2e2dab77c0eceb88a64ce3'
AND (
token = 'Xtaml5MsHFOP9zbary6lxRYw6W/e4MDDXQJZrVtge6g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)