UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jCi6r76lMzBVfGJBjIFdVWuvojbHdInYexwqcC17rc8='
WHERE
key_id = '25400c3056c7859c63920f760ea03c27cc9d8324d410690757e48c3d7a6394d2'
AND (
token = 'jCi6r76lMzBVfGJBjIFdVWuvojbHdInYexwqcC17rc8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)