UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WtggTgQu+v1IddO0OhEkUW1JFkbDqcHwjeoKGhVZtyY='
WHERE
key_id = 'd656030552bb08782c9ad9d7370a2a4f57cfd5ba5094feaec660121f37e6edc9'
AND (
token = 'WtggTgQu+v1IddO0OhEkUW1JFkbDqcHwjeoKGhVZtyY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)