UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WnOubVrU0TDk7m7UWn3j1FqoQnzWcvpCiqxfZd8ZzpA='
WHERE
key_id = '2d2cee91440506a1d4193f5428ec655c15466f9909bc5f635d1f634481e30170'
AND (
token = 'WnOubVrU0TDk7m7UWn3j1FqoQnzWcvpCiqxfZd8ZzpA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)