UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BoCqVTb2I4UvuZzGBnzW0kDY9N7FoJabbBhEzaGZzVA='
WHERE
key_id = '3d22b6db590e3746dde9e10b9ca7176733d35e3c5089fe5e6f7be67198f841e0'
AND (
token = 'BoCqVTb2I4UvuZzGBnzW0kDY9N7FoJabbBhEzaGZzVA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)