UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7uBTczGmYO1TCenJzLxY79ntmv6lmFCIvpVJucEnkXE='
WHERE
key_id = '5fbe02c2fe9a79fa0e7351719ee901103ff5a5096814807ff04e0588f3a17aa7'
AND (
token = '7uBTczGmYO1TCenJzLxY79ntmv6lmFCIvpVJucEnkXE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)